package org.minhnvt1.android.moviesearch.services;

import java.util.ArrayList;

import org.minhnvt1.android.moviesearch.model.Movie;

import android.util.Log;

public class MovieSeeker extends GenericSeeker<Movie>{
	private static final String MOVIE_SEARCH_PATH = "Movie.search/";
	public ArrayList<Movie> find(String query) {
		ArrayList<Movie> moviesList = retrieveMovieList(query);
		return moviesList;
	}

	public ArrayList<Movie> find(String query, int maxResults) {
		ArrayList<Movie> moviesList = retrieveMovieList(query);
		return retrieveFirstResults(moviesList, maxResults);
	}

	private ArrayList<Movie> retrieveMovieList(String query){
		String url = constructSearchUrl(query);
		String response = httpRetriever.retrieve(url);
		Log.d(getClass().getSimpleName(), response);
		return xmlParser.parserMovieResponse(response);
		
	}
	public String retrieveSearchMethodPath() {
		// TODO Auto-generated method stub
		return MOVIE_SEARCH_PATH;
	}

	

}
